<div class="layuimini-main">

    <div class="layui-form layuimini-form">
    	<input type="hidden"  id="taskId" />
        <div class="layui-form-item">
            <label class="layui-form-label">申请人</label>
            <div class="layui-input-block">
                <input type="text"  id="userId" readonly="readonly" class="layui-input layui-disabled">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">申请时间</label>
            <div class="layui-input-block">
               <input type="text"  id="taskcreatetime" readonly="readonly" class="layui-input layui-disabled">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">开始时间</label>
            <div class="layui-input-block">
               <input type="text"  id="start_time" readonly="readonly" class="layui-input layui-disabled">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">结束时间</label>
            <div class="layui-input-block">
               <input type="text"  id="end_time" readonly="readonly" class="layui-input layui-disabled">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">请假类型</label>
            <div class="layui-input-block">
               <input type="text"  id="leave_type" readonly="readonly" class="layui-input layui-disabled">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">请假原因</label>
            <div class="layui-input-block">
                <textarea id="reason" class="layui-textarea layui-disabled" readonly="readonly"></textarea>
            </div>
        </div>
        
        <div class="layui-form-item">
             <label class="layui-form-label">HR审批意见</label>
             <div class="layui-input-block">
                 <select id="deptleaderapprove" lay-filter="aihao">
                    	<option value="true">同意</option>
						<option value="false">拒绝</option>
                 </select>
             </div>
         </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="saveBtn">完成</button>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['form', 'table'], function () {
        var form = layui.form,
            layer = layui.layer,
            table = layui.table,
            $ = layui.$;

        /**
         * 初始化表单，要加上，不然刷新部分组件可能会不加载
         */
        form.render();

        // 当前弹出层，防止ID被覆盖
        var parentIndex = layer.index;

        //监听提交
        form.on('submit(saveBtn)', function (data) {
            $.post("deptComplete?taskid="+$("#taskId").val()+"&deptleaderapprove="+$("#deptleaderapprove").val(),function(){
	    		 // 关闭弹出层
            	layer.close(parentIndex);
	    	});
        });

    });
</script>